import req from '@/utils/request';
import * as URL from '@/constants/api';

export function getArticleList(id) {
  return req({
    method: 'get',
    url: URL.ARTICLE_LIST,
    params: {
      channel_id: id,
      timestamp: Date.now(),
    }
  })
    .then(res => res.data.data.results) // to do
    // .then(res => []) // to do
    .catch(() => []);
}


export function getArticleId(id) {
  return req({
    method: 'get',
    url: URL.ARTICLE_ID + '/' + id,
    params: {
      // article_id: id,

    }
  })
    .then(res => res.data.data) // to dores.data.data
    // .then(res => console.log(res.data.data)) // to dores.data.data
    // .then(res => []) // to do
    .catch(() => []);
}
